from entity import*
import random

class platform(entity):
    """An immovable enviornmental feature used for walls and platforms"""

    def __init__(self, manager):
        entity.__init__(self, manager)
        
        self.rect.width = 50
        self.rect.height = 50
        
        self.plat = False
        self.climb = False

    def setTexture(self, drawTex = ""):
        """If no drawTex is specified or "" is passed, it will stay as default"""
        self.type = drawTex

    def setplat(self):
        if (self.plat == False):
            self.plat = True
        elif (self.plat == True):
            self.plat = False
    def setclimb(self):
        if (self.climb == False):
            self.climb = True
        elif (self.climb == True):
            self.climb = False
        
    def draw(self, camera, screen, manager):
        entity.draw(self, camera, screen, manager)
        if(manager.editor.inEditMode):
            self.drawHandle( camera, screen)

    def drawHandle(self, camera, screen):
        pygame.draw.rect(screen, (255,255,255), (self.rect.bottomright[0] - camera.rect.topleft[0] - 15, self.rect.bottomright[1] - camera.rect.topleft[1] - 15, 15, 15))